# $Id: PKGBUILD 59030 2011-11-20 20:25:03Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Ondrej Jirman <megous@megous.com>

pkgname=mingw32-w32api
pkgver=3.17
_runtimever=3.20
_uprel=1
pkgrel=1
arch=('any')
pkgdesc="Windows header files for mingw32 C cross-compiler"
makedepends=(mingw32-gcc-base)
options=(!strip)
license=(LGPL)
url="http://www.mingw.org/"
source=(http://downloads.sourceforge.net/project/mingw/MinGW/Base/w32api/w32api-$pkgver/w32api-$pkgver-${_uprel}-mingw32-src.tar.lzma
	http://downloads.sourceforge.net/mingw/mingwrt-${_runtimever}-mingw32-src.tar.gz)
md5sums=('89e5800096aa334009f98e7c1743d825'
         '26c0886cc60729b94956cc6d81cd076c')

build()
{
  cd $srcdir/w32api-$pkgver-${_uprel}-mingw32

  mkdir -p $srcdir/include/
  cp -r $srcdir/mingwrt-${_runtimever}-mingw32/include/* $srcdir/include/
  export CFLAGS="-mms-bitfields -I$srcdir/include -I$srcdir/w32api-$pkgver-${_uprel}-mingw32/include"

  ./configure --prefix=/usr/i486-mingw32 --target=i486-mingw32 --host=i486-mingw32 --build=$CHOST
  make
  make install prefix=$pkgdir/usr/i486-mingw32

  cd $pkgdir
  find . -name '*.a' | xargs -rtl1 i486-mingw32-strip -g
}
